import request from '@/config/axios'

// 认证出版社 VO
export interface PublisherVO {
  id: number // 编号
  name: string // 名字
  status: string // 状态
  type: string // 类型
}

// 认证出版社 API
export const PublisherApi = {
  // 查询认证出版社分页
  getPublisherPage: async (params: any) => {
    return await request.get({ url: `/bk/publisher/page`, params })
  },

  // 查询认证出版社详情
  getPublisher: async (id: number) => {
    return await request.get({ url: `/bk/publisher/get?id=` + id })
  },

  // 新增认证出版社
  createPublisher: async (data: PublisherVO) => {
    return await request.post({ url: `/bk/publisher/create`, data })
  },

  // 修改认证出版社
  updatePublisher: async (data: PublisherVO) => {
    return await request.put({ url: `/bk/publisher/update`, data })
  },

  // 删除认证出版社
  deletePublisher: async (id: number) => {
    return await request.delete({ url: `/bk/publisher/delete?id=` + id })
  },

  // 导出认证出版社 Excel
  exportPublisher: async (params) => {
    return await request.download({ url: `/bk/publisher/export-excel`, params })
  },
}
